﻿package
{
	import com.controller.OverStartupCommand;
	import com.controller.StartCommand;
	import org.puremvc.as3.interfaces.IFacade;
	import org.puremvc.as3.patterns.facade.Facade;
	
	public class ApplicationFacade extends Facade implements IFacade
	{
		public static const STARTUP:String = "facadeStartup";
		public static const STARTUP_OVER:String = "facadeOverStartup";
		public static var txtUrl:String = 'assets/data.txt';
		public function ApplicationFacade()
		{
			super();
		}
		public static function getInstance():ApplicationFacade {
			if (instance == null) {
				instance = new ApplicationFacade();
			}else {
				
			}
			return instance as ApplicationFacade;
		}
		override protected function initializeFacade():void 
		{
			super.initializeFacade();
			//注册命令,发送STARTUP通告的时候执行StartCommand.execute()
			registerCommand(STARTUP, StartCommand);
			registerCommand(STARTUP_OVER, OverStartupCommand);
		}
		public function startup(obj:Object):void {
			sendNotification(STARTUP, obj);
		}
	}
}